<!doctype html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>元素获取</title>
	</head>
	<body>
		<div id="box">
			<div class="item">1</div>
		</div>
			<div class="item">2</div>

	</body>
	<script type="text/javascript">
// 动态数组
var a = document.getElementsByClassName('item');
// 静态数组
var b = document.querySelectorAll('.item');
console.log(a, b);
var newDiv = document.createElement("div");
newDiv.className = "item";
newDiv.innerHTML = "666";
document.body.appendChild(newDiv);
console.log(a, b);




	</script>
</html>